@mixin item-bg($color) {
  &::before {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 3px;
    width: 86%;
    height: 86%;
    content: '';
    background-color: $color !important;
  }
}

.el-container {
  width: 100%;
  height: 100%;

  .first-menu {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 72px;
    height: 100%;
    position: relative;
    background-color: var(--el-menu-bg-color);

    &.dark-aside::after {
      background-color: #2b2b2c;
    }

    .el-scrollbar {
      height: calc(100% - 68px);

      .first-menu-list {
        .first-menu-item {
          &:hover {
            background-color: var(--el-menu-hover-bg-color);
          }
        }

        .is-active {
          background-color: var(--el-color-primary) !important;

          i,
          .title {
            color: #ffffff !important;
          }
        }
      }

      /* 自定义菜单风格*/
      .first-menu-list.menu-card {
        .first-menu-item {
          position: relative;

          & > * {
            z-index: 1;
          }

          &:hover {
            background-color: transparent !important;
            @include item-bg(var(--el-color-info-light-9));
          }

          &.is-active {
            background-color: transparent !important;
            @include item-bg(var(--el-menu-hover-bg-color));

            & > * {
              color: var(--el-color-primary) !important;
            }
          }
        }
      }
    }
  }

  /* 展开栏 */
  .el-aside {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    background-color: var(--el-menu-bg-color);
    transition: width 0.3s ease;

    &.is-hide {
      width: 0 !important;
      border-right: none !important;
    }
    .el-scrollbar {
      height: calc(100% - var(--el-menu-item-height));

      .el-menu {
        width: 100%;
        overflow-x: hidden;
        border-right: none;
      }
    }
  }
}
